﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MulFenHuSBFP.aspx.cs" Inherits="Web.Pages.YongShui._13.LAIHANGL.MulFenHuSBFP" Theme="Default" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>水表分配</title>
    <script type="text/javascript">
        function rowClick() {
            if (gvFenHu.GetFocusedRowIndex() != -1) {
                ASPxCallback1.PerformCallback("setinfo");
            }
        }
        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];//操作类型
            var state = arr[1];//是否成功

            if (type == "setinfo") {
                if (state == 0) {
                    txtShuiBiaoBH.SetText(arr[2]);
                    txtShuiBiaoMC.SetText(arr[3]);
                    cmbFenHuH.SetValue(arr[4]);
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <div class="tabletitle1">
            水表分配
        </div>
        <asp:UpdatePanel runat="server" ID="updatePanel1">
            <ContentTemplate>
                <div>
                    <div style="width:100%">
                        <dx:ASPxGridView ID="gvFenHu" ClientInstanceName="gvFenHu"  runat="server" AutoGenerateColumns="False" 
                            KeyFieldName="S_SHUIBIAOBH" Width="100%" Theme="Aqua1">
                            <Columns>
                                <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOBH" Caption="水表编号" Width="20%" HeaderStyle-HorizontalAlign="Center">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_SHUIBIAOMC" Caption="水表名称" Width="60%" HeaderStyle-HorizontalAlign="Center">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="S_YONGHUBH" Caption="分户号" Width="20%" HeaderStyle-HorizontalAlign="Center">
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Settings HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Visible" VerticalScrollableHeight="120" />
                            <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                            <ClientSideEvents FocusedRowChanged="function(s,e){rowClick();}" />
                        </dx:ASPxGridView>
                    </div>
                    <div style="height: 5px;width:100%"></div>
                    <div style="margin:auto;width:100%;line-height:30px;">
                        <table>
                            <tr>
                                <td style="text-align:right;width:60px">水表号：</td>
                                <td style="text-align:left;width:90px">
                                    <dx:ASPxTextBox ID="txtShuiBiaoBH" ClientInstanceName="txtShuiBiaoBH" runat="server" Width="95%" ClientEnabled="false">
                                    </dx:ASPxTextBox>
                                </td>
                                <td style="text-align:right;width:70px">水表名称：</td>
                                <td style="text-align:left;width:220px">
                                    <dx:ASPxTextBox ID="txtShuiBiaoMC" ClientInstanceName="txtShuiBiaoMC" runat="server" Width="95%" ClientEnabled="false">
                                    </dx:ASPxTextBox>
                                </td>
                                <td style="text-align:right;width:60px">分户号：</td>
                                <td style="text-align:left;width:100px">
                                    <asp:Panel runat="server" ID="Panel1">
                                        <dx:ASPxComboBox runat="server" ID="cmbFenHuH" ClientInstanceName="cmbFenHuH" Width="95%">
                                            <Items>
                                                <dx:ListEditItem Text="" Value="" />
                                            </Items>
                                        </dx:ASPxComboBox>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <hr />
                    <div style="text-align: right">
                        <dx:ASPxButton ID="BtnSave" ClientInstanceName="BtnSave" runat="server" Text="保存" AutoPostBack="false" OnClick="BtnSave_Click" UseSubmitBehavior="false">
                        </dx:ASPxButton>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
